package com.wn.class30.service.impl;

import com.wn.class30.entity.Product;
import com.wn.class30.mapper.ProductDao;
import com.wn.class30.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductDao productDao;
    @Override
    public List<Product> selectProducts() throws Exception {
        return productDao.selectByExample(null);
    }

    @Override
    public Product selectProductById(Integer id) throws Exception {
        return productDao.selectByPrimaryKey(id);
    }
}
